From 9164e93203979755bfa8bf81a1e8e9f8125d4414 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roger=20Pau=20Monn=C3=A9?= Date: Fri, 29 May 2020 17:52:06 +0200 Subject: [PATCH] clang: don't define nocall MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Clang doesn't support attribute error, and the possible equivalents like diagnose_if don't seem to work well in this case as they trigger when when the function is not called (just by being used by the APPEND_CALL macro). Define nocall to a noop on clang until a proper solution can be found. Signed-off-by: Roger Pau Monné Acked-by: Julien Grall [jb: error -> __error__] Acked-by: Jan Beulich --- xen/include/xen/compiler.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xen/include/xen/compiler.h b/xen/include/xen/compiler.h index c22439b7a4..c0e0ee9f27 100644 --- a/xen/include/xen/compiler.h +++ b/xen/include/xen/compiler.h @@ -20,7 +20,11 @@ #define __weak __attribute__((__weak__)) -#define nocall __attribute__((error("Nonstandard ABI"))) +#if !defined(__clang__) +# define nocall __attribute__((__error__("Nonstandard ABI"))) +#else +# define nocall +#endif #if (!defined(__clang__) && (__GNUC__ == 4) && (__GNUC_MINOR__ < 5)) #define unreachable() do {} while (1) -- 2.30.2